﻿<script type="text/javascript">
Ext.onReady(function(){
    var btn = Ext.get("btn_login");
    btn.on("click", function(){
        Ext.Ajax.defaultHeaders = {
            'Accept': 'application/json'
        };
        var resp = Ext.Ajax.request({
            url: '/Login/',
            method: 'POST',
            success: function(resp) {
                var item = Ext.decode(resp.responseText);
				//alert(item.pass);
				//Ext.Msg.alert(String(item));					
				Ext.Msg.alert(item.pass);
				Ext.get('loginDiv').dom.parentNode.removeChild(Ext.get('loginDiv').dom);
            },
            failure: function() {
                Ext.Msg.alert('Combinacao Usuario e Senha incorretos!');
            },
			params: { username: Ext.get('username').dom.value, pass: Ext.get('pass').dom.value  }
        });
    }); // run once
});
</script>
<div class="subcontent-unit-border" id="loginDiv">
          <div class="round-border-topleft"></div>
          <div class="round-border-topright"></div>
          <h1>Área do Cliente</h1>
          <div class="loginform">
            <form action="" method="post" id="loginFrm">
              <p>
                <input type="hidden" name="rememberme" value="0" />
              </p>
              <fieldset>
                <p>
                  <label for="username" class="top">Usuário:</label>
                  <br />
                  <input name="username" type="text" class="field" id="username" tabindex="1" value="" maxlength="50" />
                </p>
                <p>
                  <label for="pass" class="top">Senha:</label>
                  <br />
                  <input name="pass" type="password" class="field" id="pass" tabindex="2" value="" maxlength="10" />
                </p>
                <p>
                  <input type="checkbox" name="checkbox" id="checkbox" class="checkbox" tabindex="3" size="1" value=""/>
                  <label for="checkbox_1" class="right">Lembre-me</label>
                </p>
                <p>
                  <input type="button" name="btn_login" class="button" value=" Entrar " id="btn_login"  />
                </p>
                <p><a href="#" onclick="webLoginShowForm(2);return false;" id="forgotpsswd_2">Esqueceu a senha?</a></p>
              </fieldset>
            </form>
          </div>
        </div>